package com.example.beidouapplication;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.Nullable;

import com.example.beidouapplication.viewmodel.Key;
import com.example.beidouapplication.viewmodel.KeyEvent;


public class FragmentSart_NM extends Fragment {

    Button btn1;
    Button btn2;

    static FragmentSart_NM instance = new FragmentSart_NM();

    @Override
    public View onCreateView(
            LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState
    ) {

        View inflate = inflater.inflate(R.layout.fragment_start_nm, container, false);
        return inflate;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        btn1 = (Button) getActivity().findViewById(R.id.btn_START_NM_1);

        btn1.setOnClickListener(v -> Menu.keyQueue.add(new KeyEvent(Key.ENTER, 1)));


        btn2 = (Button) getActivity().findViewById(R.id.btn_START_NM_2);

        btn2.setOnClickListener(v -> Menu.keyQueue.add(new KeyEvent(Key.ENTER, 2)));

    }


}